home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 37 / CD Expert nº 37.iso / LastCall / lastcall.exe / stuff / recipe.dxr / 00011_Pick from List of recipes.ls < prev    next >
Encoding:
Text File  |  2000-03-23  |  2.8 KB  |  125 lines

  1. property pSpr, pLastLine, pMember
  2. global gLastAlphabetMode, gMode, gLastAlphabetLetter, gLastLetter
  3.  
  4. on beginSprite me
  5.   pSpr = sprite(me.spriteNum)
  6.   pMember = pSpr.member
  7.   if inRecipeMode() then
  8.     pSpr.member.color = black()
  9.   end if
  10.   pLastLine = VOID
  11.   mRefresh(me, max(1, gLastLetter))
  12. end
  13.  
  14. on mRefresh me, X
  15.   if paused() then
  16.     exit
  17.   end if
  18.   if not isText(pSpr) then
  19.     exit
  20.   end if
  21.   if (gLastLetter = gLastAlphabetLetter) and (gLastAlphabetMode = gMode) then
  22.     if inGameMode() then
  23.       exit
  24.     end if
  25.   end if
  26.   gLastAlphabetMode = gMode
  27.   if not voidp(X) then
  28.     gLastLetter = X
  29.   end if
  30.   if voidp(gLastLetter) then
  31.     setIt(me, 1)
  32.   end if
  33.   gLastAlphabetLetter = gLastLetter
  34.   baseText = buildRecipeList(member("alphabet").text.char[gLastLetter])
  35.   if inRecipeMode() then
  36.     addText = EMPTY
  37.   else
  38.     addText = "Click the blue Recipes tab above to immediately view the customer's recipes currently on order." & RETURN & RETURN
  39.   end if
  40.   pMember.text = addText & baseText
  41.   pMember.text = pMember.text
  42.   if pMember.type = #text then
  43.     colorize(pMember, redDot(), red(), 1)
  44.     colorize(pMember, blueDot(), blue())
  45.     pMember.Tabs = [[#type: #left, #position: 18], [#type: #left, #position: 30], [#type: #left, #position: 72]]
  46.     pMember.scrollTop = 0
  47.   end if
  48.   if charPosToLoc(pMember, length(pMember.text)).locV > pSpr.rect.height then
  49.     pMember.boxType = #scroll
  50.   else
  51.     pMember.boxType = #fixed
  52.   end if
  53.   if baseText = "No Matching Recipes" then
  54.     return 0
  55.   else
  56.     return 1
  57.   end if
  58. end
  59.  
  60. on mouseWithin me
  61.   if paused() then
  62.     exit
  63.   end if
  64.   if not inRecipeMode() then
  65.     exit
  66.   end if
  67.   if not isText(pSpr) then
  68.     exit
  69.   end if
  70.   thisLine = PointToLine(pSpr, the mouseLoc)
  71.   if thisLine = pLastLine then
  72.     exit
  73.   end if
  74.   if thisLine > 0 then
  75.     if not voidp(pLastLine) and (pLastLine > 0) then
  76.       pSpr.member.line[pLastLine].color = black()
  77.     end if
  78.     pLastLine = thisLine
  79.     pSpr.member.line[thisLine].color = red()
  80.   end if
  81. end
  82.  
  83. on mouseEnter me
  84.   if inRecipeMode() then
  85.     pSpr.member.color = black()
  86.   end if
  87. end
  88.  
  89. on mouseLeave
  90.   if inRecipeMode() then
  91.     pSpr.member.color = black()
  92.   end if
  93. end
  94.  
  95. on mouseDown me
  96.   global gLastCurrent, gLastQuickView
  97.   if paused() then
  98.     exit
  99.   end if
  100.   if not inRecipeMode() then
  101.     go("Other")
  102.     exit
  103.   end if
  104.   if voidp(pLastLine) then
  105.     pLastLine = PointToLine(pSpr, the mouseLoc)
  106.     if voidp(pLastLine) then
  107.       pLastLine = 1
  108.     end if
  109.   end if
  110.   RECID = findRecipeByName(pSpr.member.line[pLastLine], 2)
  111.   if RECID then
  112.     reply = checkForSpecialRecipe(RECID, 1)
  113.     if reply <> #help then
  114.       if gLastQuickView then
  115.         goToLabel("quickView")
  116.       else
  117.         gLastCurrent = 2
  118.         goToLabel("Current2")
  119.       end if
  120.     end if
  121.     updateStage()
  122.     manualRecipeChoice(RECID)
  123.   end if
  124. end
  125.